﻿
Partial Class create_user
    Inherits System.Web.UI.Page

    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
        Dim userid As String = Membership.GetUser(CreateUserWizard1.UserName).ProviderUserKey.ToString
        Dim uni_id As DropDownList = CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UniDropDownList")
        Try
            ACSService.addUniAdmin(userid, uni_id.SelectedValue.ToString)
            Dim User As MembershipUser = Membership.GetUser(CreateUserWizard1.UserName)
            User.Comment = uni_id.SelectedItem.Text
            Roles.AddUserToRole(User.UserName, "Role_Uni_Admin")
            Membership.UpdateUser(User)
        Catch ex As Exception
            Membership.DeleteUser(CreateUserWizard1.UserName)
            Throw New Exception("Account not created")
        End Try
    End Sub
End Class
